<!DOCTYPE html>
<html
        layout:decorator="component/mainLayout"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:th="http://www.thymeleaf.org"
        lang="en" xmlns:layout="http://www.w3.org/1999/xhtml">
<div layout:fragment="contentCenter">
        <!--<div class="mdui-col-md-12 mdui-center">-->
            <!--<button class="mdui-btn mdui-btn-raised mdui-color-red-accent mdui-col-xs-1">查询</button>-->
            <!--<input type="type" class="form-control" id="oldPassword" placeholder="原密码">用户名-->
        <!--</div>-->
    <div >
        <input type="text" class="input-sm" id="searchUserName" placeholder="请输入姓名">
        <button class="mdui-btn mdui-btn-raised mdui-color-red-accent" id="search-btn">查询</button>
    </div>

    <div class="mdui-table-fluid" id="userTableId">

    </div>

<script>
        queryPageData();

    $(document).ready(function () {
        sliderCollapse.open('#userCollapse');
    })

    $("#search-btn").click(function () {
        queryPageData();
    })

    function queryPageData(){
        var pageSize=$('#pageSizeId').val();
        var pageNum=$('#queryPageNum').val();

        $.ajax({
            type: 'GET',
            url: '/admin/userListContent',
            data: {
                size:pageSize,
                page:pageNum,
                // userId:$('#searchUserId').val(),
                userName:$('#searchUserName').val()?$('#searchUserName').val():null,
                // deleteFlag:$('#userStatus').val()
            },
            success: function (response) {
                $('#userTableId').empty().append(response);
            },
            error: function (response) {

            }

        })
    }

    function userDetail() {
        var event = window.event;
        var userId = $(event.target).parents("tr").find("input[name=userId]").val();
        layui.use(['layer'],function () {
            var layer = layui.layer;
            layer.open({
                title:'用户信息',
                type:2,
                area: ['500px','400px'],
                shift:2,
                content:'/admin/userDetail?userId='+userId,
                closeBtn:2,
                btn:false
            })
        })
    }

</script>
</div>
</html>